<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>fuser</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_001_014_795">&nbsp;</a>NAME</h4><blockquote>
fuser - list process IDs of all processes that have one or more
files open
</blockquote><h4><a name = "tag_001_014_796">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

fuser <b>[</b> -cfu <b>]</b><i> file</i><b> ...
</b></code>
</pre>
</blockquote><h4><a name = "tag_001_014_797">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>fuser</i>
utility writes to standard output the process IDs of
processes running on the local system that have one or more
named files open.
For block special devices, all processes
using any file on that device are listed.
<p>
The
<i>fuser</i>
utility writes to standard error additional
information about the named files indicating how the file is
being used.
<p>
Any output for processes running on remote systems that have a
named file open is unspecified.
<p>
A user may need appropriate privilege to invoke the
<i>fuser</i>
utility.
</blockquote><h4><a name = "tag_001_014_798">&nbsp;</a>OPTIONS</h4><blockquote>
The
<i>fuser</i>
utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> .
<p>
The following options are supported:
<dl compact>

<dt><b>-c</b>
<dd>The file is treated as a mount point and the utility reports
on any files open in the file system.

<dt><b>-f</b>
<dd>The report is only for the named files.

<dt><b>-u</b>
<dd>The user name, in parentheses, associated with each process
ID written to standard output is written to standard error.

</dl>
</blockquote><h4><a name = "tag_001_014_799">&nbsp;</a>OPERANDS</h4><blockquote>
<dl compact>

<dt><i>file</i><dd>A pathname on which the file or file system is to be reported.

</dl>
</blockquote><h4><a name = "tag_001_014_800">&nbsp;</a>STDIN</h4><blockquote>
Not used.
</blockquote><h4><a name = "tag_001_014_801">&nbsp;</a>INPUT FILES</h4><blockquote>
The user database.
</blockquote><h4><a name = "tag_001_014_802">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>
The following environment variables affect the execution of
<i>fuser</i>:
<dl compact>

<dt><i>LANG</i><dd>Provide a default value for the internationalization
variables that are unset or null.
If
<i>LANG</i>
is unset or null, the corresponding value from the
implementation-dependent default locale will be used.
If any of the internationalization variables contain an invalid setting,
the utility will behave as if none of the variables had been set.

<dt><i>LC_ALL</i><dd>If set to a non-empty string value, override the values of
all the other internationalization variables.

<dt><i>LC_CTYPE</i><dd>
Determine the locale for the interpretation of sequences of
bytes of text data as characters (for example, single- as
opposed to multi-byte characters in arguments).

<dt><i>LC_MESSAGES</i><dd>
Determine the locale that should be used to affect
the format and contents of diagnostic messages written to
standard error.

<dt><i>NLSPATH</i><dd>
Determine the location of message catalogues for the
processing of
<i>LC_MESSAGES .
</i>
</dl>
</blockquote><h4><a name = "tag_001_014_803">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_804">&nbsp;</a>STDOUT</h4><blockquote>
The
<i>fuser</i>
utility will write the process ID for each process
using each file given as an operand to standard output in the
following format:
<pre>
<code>
"%d", &lt;<i>process_id</i>&gt;
</code>
</pre>
</blockquote><h4><a name = "tag_001_014_805">&nbsp;</a>STDERR</h4><blockquote>
The
<i>fuser</i>
utility writes diagnostic messages to standard error.
<p>
The
<i>fuser</i>
utility also writes the following to standard error:
<ul>
<p>
<li>
The pathname of each named file is written followed
immediately by a colon.
<p>
<li>
For each process ID written to standard output, the
character c is written to standard error if the process
is using the file as its current directory and the
character r is written to standard error if the process
is using the file as its root directory.
Implementations may write other alphabetic characters to indicate other
uses of files.
<p>
<li>
When the
<b>-u</b>
option is specified, characters indicating
the use of the file are followed immediately by the user
name, in parentheses, corresponding to the process'
real user ID.
If the user name cannot be resolved from
the process' real user ID, the process' real user ID
is written instead of the user name.
<p>
</ul>
<p>
When standard output and standard error are directed to the
same file, the output is interspersed so that the filename
appears at the start of each line, followed by the process ID
and characters indicating the use of the file.
Then, if the
<b>-u</b>
option is specified, the user name or user ID for each
process using that file is written.
<p>
A new line character is written to standard error after the
last output described above for each file operand.
</blockquote><h4><a name = "tag_001_014_806">&nbsp;</a>OUTPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_807">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_808">&nbsp;</a>EXIT STATUS</h4><blockquote>
The following exit values are returned:
<dl compact>

<dt> 0<dd>Successful completion.

<dt>&gt;0<dd>An error occurred.

</dl>
</blockquote><h4><a name = "tag_001_014_809">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_810">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_811">&nbsp;</a>EXAMPLES</h4><blockquote>
The command:
<pre>
<code>
fuser -fu .
</code>
</pre>
<p>
writes to standard output the process IDs of processes that
are using the current directory and writes to standard error
an indication of how those processes are using the directory
and the user names associated with the processes that are
using the current directory.
</blockquote><h4><a name = "tag_001_014_812">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_813">&nbsp;</a>SEE ALSO</h4><blockquote>
None.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
